package com.ktjy.controller;


import com.ktjy.entity.Livecommerce;
import com.ktjy.service.LivecommerceService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;

@Controller
@RequestMapping("/live")
public class LivecommerceController {
    @Autowired
    private LivecommerceService livecommerceService;

    @GetMapping("/select")
    public String queryAndRedirect(Model model) {
        List<Livecommerce> list = livecommerceService.select();
        model.addAttribute("list", list);
        return "select";
    }



}
